#! /bin/sh

#
# Check VTOP translation for IBM POWER with 64k pages.
#

pf="ppc64_linux_rpn30:16,12,12,4"

# PGD[0] -> 8000
ptes="-e 0x0000:0xc000000000008000"
# PGD[1] -> 20000
ptes="$ptes -e 0x0008:0xc000000000020000"
# PGD[2] -> c0000000000  (1T)
ptes="$ptes -e 0x0010:0x0300000000000003"
# PGD[3] -> 40000 (1G huge PD)
ptes="$ptes -e 0x0018:0x400000000004002c"
# PGD[0] -> PMD[0] -> 10000
ptes="$ptes -e 0xc000000000008000:0xc000000000010000"
# PGD[0] -> PMD[1] -> d0000000 (256M)
ptes="$ptes -e 0xc000000000008008:0x340000000003"
# PGD[0] -> PMD[2] -> 50000 (16M huge PD)
ptes="$ptes -e 0xc000000000008010:0x4000000000050020"
# PGD[0] -> PMD[0] -> PTE[0] -> a0000
ptes="$ptes -e 0xc000000000010000:0x280000391"
# PGD[1] -> PMD[2] -> 30000
ptes="$ptes -e 0xc000000000020010:0xc000000000030000"
# PGD[1] -> PMD[2] -> PTE[3] -> b0000
ptes="$ptes -e 0xc000000000030018:0x2c0000391"
# PGD[3] -> hugepd[2] -> 380000000
ptes="$ptes -e 0xc000000000040010:0xe00000000003"
# PGD[0] -> PMD[2] -> hugepd[3] -> f000000
ptes="$ptes -e 0xc000000000050018:0x3c000000003"

list="0xd000000000001234:0xa1234"	      # PGD[0] -> PMD[0] -> PTE[0]
list="$list 0xd000010020034567:0xb4567"	      # PGD[1] -> PMD[2] -> PTE[3]
list="$list 0xd000023456789abc:0xc3456789abc" # PGD[2]
list="$list 0xd000000012345678:0xd2345678"    # PGD[0] -> PMD[1]
list="$list 0xd000030087654321:0x387654321"   # PGD[3] -> hugepd[2]
list="$list 0xd000000023456789:0xf456789"     # PGD[0] -> PMD[2] -> hugepd[3]

. "$srcdir"/addrxlat-common
